import { combineReducers } from "redux";

import count from "./count";
import count2 from "./count2";
import counterReducer from "./counter";

const rootReducer = (state, action) => {
  switch (action.type) {
      case ADD_COUNT:
          return {...state,number : state.number+1}
      case REDUCE_COUNT:
          return {...state,number : action.count-1}
      default:
          return state
  }
}
// 使用 ES6 的对象字面量简写方式定义对象结构
export default combineReducers({
  count,
  count2,
  counterReducer
});